
					<article>
						<h1>Data Lokasi</h1>
						<form id="form" action="" method="post" class="styled">
							<div style="float:left">
								<b>Search :</b>
								<input type="text" name="q" id='q' value="<?php echo $q ?>" />
								<?php echo str_repeat("&nbsp;",3)?>
								<b>Page :</b>
								<select name="page" onChange="$('#form').submit()">
									<?php
										$total = $lokasi['count']->num_rows();
										$totpage=0;
										if(($total%$limit) == 0)
											$totpage=$total/$limit;
										else
											$totpage=(int)($total/$limit) + 1;
										
										echo "<option value='1' ".(1 == $page?'selected="selected"':'')." >&nbsp;1</option>";
										for($i=2;$i<=$totpage;$i++){
											echo "<option value='$i' ".($i == $page?'selected="selected"':'')." >&nbsp;$i</option>";
										}
									?>
								</select>
								<?php echo str_repeat("&nbsp;",3)?>
								<input type="submit" class="button blue" value="Apply">
								<?php echo str_repeat("&nbsp;",3)?>
								<a href="<?php echo base_url()."admin/lokasi/form.html"?>" class="button fancybox">Tambah Data</a>
							</div>
							<div style="float:right">
								<?php echo "<b>RECORD ".($page*$limit-$limit+1)." - ".($page==$totpage?$total:$page*$limit)." FROM $total</b>";?>
							</div>
						</form>
						<br />
						<table class="table" width="100%" >
							<thead>
								<th>#</th>
								<th>Nama Lokasi</th>
								<th>Alamat</th>
								<th>Keterangan</th>
								<th>Kota</th>
								<th align="center">Published</th>
								<th>Dibuat Oleh</th>
								<th>Action</th>
							</thead>							
							<tbody>
							<?php foreach($lokasi['data']->result_array() as $row){?>
								<tr>
									<td><?php echo $row['photo']!=''?'<img src="'.base_url().'images/location/'.$row['photo'].'" width="50" height="50" />':''?></td>
									<td><?php echo $row['nama']?></td>
									<td><?php echo nl2br($row['alamat'])?></td>
									<td><?php echo nl2br($row['keterangan'])?></td>
									<td><?php echo $row['nama_kota']?></td>
									<td align="center"><img src="<?php echo base_url()?>template/css/images/<?php echo $row['published']=="yes"?"tick":"exclamation-red"?>.png" border=0 title="<?php echo $row['published']?>" /></td>
									<td><?php echo $row['nama_user']?></td>
									<td>
									<a href="<?php echo base_url().'admin/lokasi/form/'.$row['id']?>" class="fancybox"><img src="<?php echo base_url()?>template/css/images/edit.png" border=0 title="Edit" /></a>
									&nbsp;
									<a href="<?php echo base_url().'admin/lokasi/delete/'.$row['id']?>"><img src="<?php echo base_url()?>template/css/images/cross.png" border=0 title="Hapus" onClick="return confirm('Data akan dihapus. Lanjutkan ?')" /></a>
									</td>
								</tr>
							<?php } ?>
							</tbody>
						</table>
					</article>